import request from '@/utils/request'

// 获取区域
export const listNoPage = (query) => {
  return request({
    url: '/iot/region/listNoPage',
    method: 'get',
    params: query
  })
}

// 获取房间
export const listRoom = (query) => {
    return request({
      url: '/iot/room/list',
      method: 'get',
      params: query
    })
  }


// 新增区域
export const addRegion = (data) => {
    return request({
      url: '/iot/region',
      method: 'post',
      data
    })
  }


// 编辑区域
export const editRegion = (data) => {
    return request({
      url: '/iot/region',
      method: 'put',
      data
    })
  }
// 删除区域
export const delRegion = (id) => {
    return request({
      url: '/iot/region/' + id,
      method: 'delete'
    })
  }     

// 新增房间
export const addRoom = (data) => {
    return request({
      url: '/iot/room',
      method: 'post',
      data
    })
  }
 
// 修改房间
export const editRoom = (data) => {
    return request({
      url: '/iot/room',
      method: 'put',
      data
    })
  }

// 删除房间
export const delRoom = (id) => {
    return request({
      url: '/iot/room/' + id,
      method: 'delete'
    })
  }     